home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
PowerPlant
/
BlueLibrary Pack1 v1.1
/
BlueLibrary Pack1 ƒ
/
BD Common ƒ
/
CDividedView.h
< prev
next >
Wrap
Text File
|
1996-04-22
|
2KB
|
73 lines
// ===========================================================================
// CDividedView.cp
// Written by Christophe Causer
// ©1996 BlueDays Software. All Rights Reserved.
//
// You may use this class in any non-commercial program without
// permission. The only restriction is that you must credit the
// author in your about box. For commercial use, please contact
// the author at the email address below.
//
// Send bug-reports and comments to bluedays@kagi.com
//
// ===========================================================================
#pragma once
#include <LView.h>
#pragma options align=mac68k
typedef struct SDividerInfo {
PaneIDT topLeftPaneID;
PaneIDT bottomRightPaneID;
Int16 topLeftMinSize;
Int16 bottomRightMinSize;
Int16 topLeftPaneBorderSize;
Int16 bottomRightPaneBorderSize;
Int32 dividerPos;
Int8 isHorizontal;
} SDividerInfo;
#pragma options align=reset
class CDividedView : public LView
{
public:
enum {class_ID = 'divv'};
static CDividedView* CreateDividedViewStream(LStream *inStream);
CDividedView(LStream *inStream);
virtual ~CDividedView();
virtual void FinishCreateSelf();
virtual void DrawSelf();
virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
virtual void AdjustCursorSelf(Point inPortPt, const EventRecord &inMacEvent);
virtual void ResizeFrameBy(Int16 inWidthDelta, Int16 inHeightDelta, Boolean inRefresh);
protected:
Cursor mHCursor;
Cursor mVCursor;
LPane *mTopLeftPane; // top or left view
LPane *mBottomRightPane; // bottom or right view
PaneIDT mTopLeftPaneID; // top or left view
PaneIDT mBottomRightPaneID; // bottom or right view
Int16 mDividerPos; // where is the divider?
Int16 mMinTopLeftSize; // mimimum size of top (or left) pane
Int16 mMinBottomRightSize; // minimum size of bottom (or right) pane
Int16 mTopLeftPaneBorderSize;
Int16 mBottomRightPaneBorderSize;
Boolean mIsHorizontal; // top/bottom or left/right configuration?
private:
virtual void MoveDividerBy(Int16 inDelta);
virtual void MoveDividerTo(Int16 inPosition);
virtual void CalcDividerRect(Rect &outRect);
};